Image processing method and image processing apparatus

ABSTRACT

The invention provides an image processing method and an image processing apparatus suitably applied to an image reading apparatus such as an OCR or a facsimile, by which a drop or a break of a thin line which is caused by a little inclination of an original can be prevented with certainty by a simple processing procedure without emphasizing noise and besides sharp binary digitization processing which does not cause blurring or distortion can be performed even where color characters are present discretely in the original. When a density value of a noticed picture element upon binary processing is lower than a predetermined threshold level, a binary value error of a picture element on the opposite side to the noticed picture element in a main scanning direction or a sub scanning direction is added to the density value of the noticed picture element to obtain a sum value, and the sum value is compared with the predetermined threshold level. When the sum value is equal to or higher than the predetermined threshold level, binary digitization is performed for the noticed picture element.

This is a divisional of application Ser. No. 08/250,506, filed May 27,1994.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to an image processing method and an imageprocessing apparatus suitably applied to an image reading apparatus suchas an OCR (Optical Character Reader) or a facsimile, and moreparticularly to an image processing method and an image processingapparatus wherein a video signal (density value signal) from an opticalsensor such as a CCD (Charge Coupled Device) is converted into a digitalsignal and the digital signal is processed by binary digitizationprocessing to obtain binary values of white and black.

2. Description of the Related Art

In recent years, it is a common practice with an image reading apparatussuch as a copying machine or a facsimile to use and scan an opticalsensor such as a CCD in a main scanning direction (for example, alateral direction of an original) and a sub scanning direction (forexample, a longitudinal direction of an original) and process the thusread image data by digital processing.

When the apparatus of the type described is used to read a document or adrawing on which a longitudinal or lateral straight line such as, forexample, a ruled line shown in FIG. 15, if the line is inclined a littlerelative to the main scanning direction or the sub scanning directiondue to inclined arrangement of the original as seen in FIG. 16, thenwhere the line spans over two picture elements in the main scanningdirection or the sub scanning direction, the density value detected bythe optical sensor is separated between the two picture elements as at aportion P1 or P2 in FIG. 18. Consequently, the density value does notreach a predetermined threshold level, which is used upon binarydigitization processing, at any of the two picture elements, and the twopicture elements are determined to be both white.

Consequently, the line of the image exhibits a partial drop or drops asseen in FIGS. 17 and 18, resulting in significant visual deteriorationin picture quality. It is to be noted that, in FIGS. 16 and 18, eachsquare represents a picture element as a minimum unit for which adensity value is detected by an optical sensor, and the rightwarddirection in FIGS. 16 and 18 is the main scanning direction while thedownward direction in FIGS. 16 and 18 is the sub scanning direction.

In order to prevent such a drop of a straight line as described above,an image reading apparatus employs contour emphasis processing by MTF(Modulation Transfer Function) correction. In the contour emphasisprocessing, if it is assumed that, for example, the density values ofpicture elements of a 3×3 matrix are represented by A to I as seen inFIG. 19 and the noticed picture element which makes an object for binarydigitization processing is the center picture element having the densityvalue E, the density value of the noticed picture element is given,using the density values of the eight picture elements around thepicture element, by the following expression (1):

    |E-(A+B+C+D+F+G+H+I)/8|×α+E  (1)

where α is a predetermined constant.

Meanwhile, as a result of the progress of image processing apparatus inrecent years, even it is possible to handle images close to naturalpictures such as multi-value images or color images. However, in suchpractical industries as the OA (Office Automation) industry, binaryimages of white and black are handled mainly. This is because almost allobjects for an image to be handled are characters. Although such a coloras red or blue is used partially for the object of emphasis in materialsfor explanation, if many different colors are used, then it is less easyto recognize the image, and accordingly, there is some limitation innumber of colors which may be used.

Although there is no particular problem when a document which involvessome note written in red or blue is read by a person, if it is tried toread the document by an OCR or a facsimile which is designed to read abinary image of white and black, then a color of red becomes blurredwhereas a color of green cannot be read. Even if a color scanner isemployed, since normally a color sensor includes sensors for R, G, and B(red, green and blue) arranged successively in an order, the locationsread by the individual color sensors are delicately different from eachother. Consequently, such a character as a Chinese character isdistorted even where the character is of the 12 point size, and cannotbe used for an OCR or cannot be read readily by a facsimile.

Therefore, it is a popular measure to adjust the threshold level to beused for binary digitization processing based on a read density value asdisclosed in Japanese Patent Laid-Open Application No. Showa 59-54376 orto employ contour emphasis processing in order to artificially adjustblurring or distortion.

With the image processing method described above, however, if suchcontour emphasis processing as described above is performed inaccordance with the equation (1) above, also noise is emphasized, andaccordingly, correction by a great amount cannot be performed.Meanwhile, although it may seem a promising idea to increase theresolution of the sensor, the apparatus becomes expensive and besidesthe amount of image data to be processed is increased. Accordingly, theidea does not provide a direct solution.

Further, when it is tried to perform, upon reading of an originalprinted in two colors or a like original, artificial adjustment bythreshold level adjustment or contour emphasis processing, it sometimesoccurs that, even if one of the two colors can be read with certainty,the other color cannot be read with certainty. Accordingly, when adocument image in which two or more colors are used is read as a binaryimage of white and black, particularly where color characters arepresent discretely in a document, a sharp character image cannot beproduced.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide an image processingmethod and an image processing apparatus by which a drop or a break of athin line which is caused by a little inclination of an original can beprevented with certainty by a simple processing procedure withoutemphasizing noise.

It is another object of the present invention to provide an imageprocessing method and an image processing apparatus by which sharpbinary digitization processing which does not cause blurring ordistortion can be performed even where color characters are presentdiscretely in an original.

In order to attain the objects described above, according to an aspectof the present invention, there is provided an image processing methodwhich involves binary digitization processing wherein density valuesobtained from a sensor, which is provided for scanning image data in amain scanning direction and a perpendicular subscanning direction todetect a density value of the image data for each picture element, arecompared for the individual picture elements with a threshold level toconvert each of the density values into one of two binary values ofwhite and black, comprising the steps of adding, when, upon such binarydigitization processing, the density value of a noticed picture elementis lower than the threshold level, a binary value error of a pictureelement on the opposite side to the noticed picture element in the mainscanning direction or the sub scanning direction to the density value ofthe noticed picture element to obtain a sum value, comparing the sumvalue with the threshold level, and outputting, when the sum value isequal to or higher than the threshold level, a black signal for thenoticed picture element.

According to another aspect of the present invention, there is providedan image processing method which involves binary digitization processingwherein density values obtained from a sensor, which is provided forscanning image data in a main scanning direction and a perpendicularsubscanning direction to detect a density value of the image data foreach picture element, are compared for the individual picture elementswith a threshold level to convert each of the density values into one oftwo binary values of white and black, comprising the steps of adding,when, upon such binary digitization processing, the density value of anoticed picture element is lower than the threshold level, a binaryvalue error of a picture element on the opposite side to the noticedpicture element in the main scanning direction to the density value ofthe noticed picture element to obtain a first sum value and addinganother binary value error of another picture element on the oppositeside to the noticed picture element in the sub scanning direction to thedensity value of the noticed picture element to obtain a second sumvalue, comparing the first sum value and the second value with thethreshold level, and outputting, when at least one of the first sumvalue and the second sum value is equal to or higher than the thresholdlevel, a black signal for the noticed picture element. The thresholdlevel for comparison may be set to different values for the first sumvalue and the second sum value.

The image processing methods may be constructed such that, the binaryvalue error is set to "0" when a binary digitization value of thepicture element having the binary value error is a black signal, butwhen the binary digitization value of the picture element having thebinary value error is a white signal, the binary value error is set tothe density value of the picture element before binary digitizationprocessing.

According to a further aspect of the present invention, there isprovided an image processing apparatus, which comprises a sensor forscanning image data in a main scanning direction and a perpendicular subscanning direction to detect a density value of the image data for eachpicture element, and binary digitization means for comparing the densityvalues obtained from the sensor for the individual picture elements witha threshold level to convert each of the density values into one of twobinary values of white and black, the binary digitization meansincluding first comparison means for comparing the density value of anoticed picture element with the threshold level and outputting a blacksignal when the density value of the noticed picture element is equal toor higher than the threshold level, storage means for storing a binaryvalue error of a picture element on the opposite side to the noticedpicture element in the main scanning direction or the sub scanningdirection, addition means for adding, when the first comparison meansdetermines that the density value of the noticed picture element islower than the threshold level, the binary value error stored in thestorage means to the density value of the noticed picture element,second comparison means for comparing the result of addition by theaddition means with the threshold level and outputting a black signalwhen the result of addition is equal to or higher than the thresholdlevel; and a logical OR gate for logically ORing an output of the firstcomparison means and an output of the second comparison means with eachother and outputting the result of logical ORing as a result of binarydigitization processing.

According to a still further aspect of the present invention, there isprovided an image processing apparatus, which comprises a sensor forscanning image data in a main scanning direction and a perpendicular subscanning direction to detect a density value of the image data for eachpicture element, and binary digitization means for comparing the densityvalues obtained from the sensor for the individual picture elements witha threshold level to convert each of the density values into one of twobinary values of white and black, the binary digitization meansincluding first comparison means for comparing the density value of anoticed picture element with the threshold level and outputting a blacksignal when the density value of the noticed picture element is equal toor higher than the threshold level, first storage means for storing abinary value error of a picture element on the opposite side to thenoticed picture element in the main scanning direction, second storagemeans for storing a binary value error of another picture element on theopposite side to the noticed picture element in the sub scanningdirection, first addition means for adding, when the first comparisonmeans determines that the density value of the noticed picture elementis lower than the threshold level, the binary value error of the pictureelement on the opposite side to the noticed picture element in the mainscanning direction stored in the first storage means to the densityvalue of the noticed picture element, second addition means for adding,when the first comparison means determines that the density value of thenoticed picture element is lower than the threshold level, the binaryvalue error of the picture element on the opposite side to the noticedpicture element in the sub scanning direction stored in the secondstorage means to the density value of the noticed picture element,second comparison means for comparing the result of addition by thefirst addition means with the threshold level and outputting a blacksignal when the result of addition is equal to or higher than thethreshold level, third comparison means for comparing the result ofaddition by the second addition means with the threshold level andoutputting a black signal when the result of addition is equal to orhigher than the threshold level, and a logical OR gate for logicallyORing an output of the first comparison means, an output of the secondcomparison means and an output of the third comparison means andoutputting the result of logical ORing as a result of binarydigitization processing. The threshold level for comparison may be setto different values for the second comparison means and the thirdcomparison means.

Both of the image processing apparatus may be constructed such that thebinary value error is set to "0" when a binary digitization value of thepicture element having the binary value error is a black signal, butwhen the binary digitization value of the picture element having thebinary value error is a white signal, the binary value error is set tothe density value of the picture element before binary digitizationprocessing.

With the image processing methods and the image processing apparatus,when the noticed picture element has a density value lower than thethreshold level, a binary value error of a picture element on theopposite side to the noticed picture image in the main scanningdirection or the sub scanning direction is added to the density value ofthe noticed picture element to obtain a sum value and the sum value iscompared with the threshold level to effect binary value determinationof the threshold value between white and black thereby to restore thedensity value of the thin line divided into two picture elements.Consequently, the image processing methods and the image processingapparatus are advantageous in that a drop or a break of a thin linewhich is caused by a little inclination of an original can be preventedwith certainty by a simple processing procedure without emphasizingnoise.

According to a yet further aspect of the present invention, there isprovided an image processing method wherein analog density valuesobtained from a sensor, which detects a density value of image data foreach picture element, are converted into digital density values byanalog to digital conversion means, which converts analog density valuesobtained from the sensor into digital density values of a fixed numberof bits for a conversion density range, and the digital density valuesthus obtained are compared for the individual picture elements with athreshold level to convert each of the digital density values into oneof two binary values of white and black, comprising the steps ofproducing a histogram of density values of a noticed picture element andpicture elements around the noticed picture element, setting aconversion density range for the noticed picture element in response toa density range of a peak appearing in the histogram, and converting adigital density value of the noticed picture element from the analog todigital conversion means into another digital density value using ascale obtained by dividing the set conversion density range by a numberprovided by the fixed number of bits.

According to a yet further aspect of the present invention, there isprovided an image processing method wherein analog density valuesobtained from a sensor, which detects a density value of image data foreach picture element, are converted into digital density, values byanalog to digital conversion means, which converts analog density valuesobtained from the sensor into digital density values of a fixed numberof bits for a conversion density range, and the digital density valuesthus obtained are compared for the individual picture elements with athreshold level to convert each of the digital density values into oneof two binary values of white and black, comprising the steps ofproducing a histogram of density values of a noticed picture element andpicture elements around the noticed picture element, modifying theconversion density range of the analog to digital conversion means inresponse to a density range of a peak appearing in the histogram, andconverting, by the analog to digital conversion means, an analog densityvalue of the noticed picture element into a digital density value usinga scale obtained by dividing the modified conversion density range by anumber provided by the fixed number of bits.

According to a yet further aspect of the present invention, there isprovided an image processing apparatus, which comprises a sensor fordetecting a density value of image data for each picture element, analogto digital conversion means for converting analog density valuesobtained from the sensor into digital density values of a fixed numberof bits for a conversion density range, binary digitization means forcomparing the digital density values from the analog to digitalconversion means for the individual picture elements with a thresholdlevel to convert each of the digital density values into one of twobinary values of black and white, histogram production means forproducing a histogram of density values of a noticed picture element andpicture elements around the noticed picture element, setting-means forsetting a conversion density range for the noticed picture element inresponse to a density range of a peak appearing in the histogramproduced by the histogram production means, and conversion means forconverting the digital density value of the noticed picture element fromthe analog to digital conversion means into another digital densityvalue using a scale obtained by dividing the conversion density rangeset by setting means by a number provided by the fixed number of bits.Preferably, the conversion means includes a lookup table which is usedalso for a memory for γ conversion.

According to a yet further aspect of the present invention, there isprovided an image processing apparatus, which comprises a sensor fordetecting a density value of image data for each picture element, analogto digital conversion means for converting analog density valuesobtained from the sensor into digital density values of a fixed numberof bits for a conversion density range, conversion density range settingmeans for setting the conversion density range of the analog to digitalconversion means, binary digitization means for comparing the digitaldensity values from the analog to digital conversion means for theindividual picture elements with a threshold level to convert each ofthe digital density values into one of two binary values of black andwhite, histogram production means for producing a histogram of densityvalues of a noticed picture element and picture elements around thenoticed picture element, and conversion density range modification meansfor modifying the conversion density range set by the conversion densityrange setting means in response to a density range of a peak appearingin the histogram produced by the histogram production means. The imageprocessing apparatus may be constructed such that the conversion densityrange setting means includes ground color level setting means forsetting an analog density value corresponding to a ground color of theimage data detected by the sensor as a ground color level referencevalue, high density level setting means for setting an analog densityvalue corresponding to high density side image data detected by thesensor as a high density level reference value, and low density levelsetting means for setting an analog density value corresponding to lowdensity side image data detected by the sensor as a low density levelreference value, and the conversion density range modification means isconstructed as change-over means for selecting one of the high densitylevel reference value from the high density level setting means and thelow density level reference value from the low density level settingmeans in response to the density range of the peak appearing in thehistogram produced by the histogram production means and outputting theselected reference level to the analog to digital conversion means, theconversion density range for the analog to digital conversion meansbeing set in accordance with the ground color level reference value fromthe ground color level setting means and the selected reference valuefrom the change-over means.

With the image processing methods and the image processing apparatus,there is an advantage in that, since the density conversion range by theanalog to digital conversion means is suitably modified in response tothe density range of a peak in the histogram obtained by the histogramproduction means, even when image data of a document image or a likeimage in which two or more colors are used are read as a binary image ofwhite and black (even when color characters are present discretely inthe document), sharp binary digitization processing which does not causeblurring or distortion can be performed.

Further objects, features and advantages of the present invention willbecome apparent from the following detailed description when read inconjunction with the accompanying drawings in which like parts orelements are denoted by like reference characters.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an aspect of the presentinvention;

FIG. 2 is a similar view but illustrating another aspect of the presentinvention;

FIG. 3 is a similar view but illustrating a further aspect of thepresent invention;

FIG. 4 is a similar view but illustrating a still further aspect of thepresent invention;

FIG. 5 is a block diagram of an apparatus to which an aspect of theimage processing method of the present invention is applied showing afirst preferred embodiment of the present invention;

FIG. 6 is a diagrammatic view illustrating density values of a noticedpicture element and picture elements around the noticed picture elementin the image processing method of the first embodiment of the presentinvention;

FIG. 7 is a flow chart illustrating the image processing method of thefirst embodiment of the present invention;

FIG. 8 is a diagrammatic view illustrating an example of correction fora drop of a thin line by the image processing method of the firstembodiment of the present invention;

FIG. 9 is a block diagram of another apparatus to which another aspectof the image processing method of the present invention is appliedshowing a second preferred embodiment of the present invention;

FIG. 10 is a block diagram showing a detailed construction of afrequency value detector (histogram production means) of the imageprocessing apparatus shown in FIG. 9;

FIG. 11 is a graph illustrating a popular CCD output when the groundcolor, red characters and black characters are read;

FIG. 12 is a graph showing an example of a histogram of density valueswhen black characters are read using white and black references;

FIG. 13 is a graph showing another example of a histogram of densityvalues when red characters are read using the white and blackreferences;

FIG. 14 is a block diagram of a further apparatus to which a furtheraspect of the image processing method of the present invention isapplied showing a third preferred embodiment of the present invention;

FIG. 15 is a diagrammatic view showing an example of an original whichmakes an object for reading of an image;

FIG. 16 is a diagrammatic view showing, in an enlarged scale, a thinline in an original which extends in an inclined condition with respectto a scanning direction of the original;

FIG. 17 is a diagrammatic view illustrating an example of reading of animage in which a break or a drop of a thin line is involved;

FIG. 18 is a diagrammatic view showing, in an enlarged scale, a break ordrop of the thin line shown in FIG. 17; and

FIG. 19 is a diagrammatic view illustrating contour emphasis processing.

DESCRIPTION OF THE PREFERRED EMBODIMENTS a. Aspects of the Invention

Referring first to FIG. 1, there is shown an image processing apparatusaccording to an aspect of the present invention. The image processingapparatus includes a sensor 1 for scanning an original not shown in amain scanning direction and a sub scanning direction to detect thedensity value of image data each picture element, and binarydigitization means 3 for comparing density values obtained by the sensor1 for the individual picture elements with a predetermined thresholdlevel to convert each of the density values into one of two binaryvalues of white and black.

The binary digitization means 3 includes first comparison means 4,storage means 5, addition means 6, second comparison means 7, and alogical OR gate 8.

The first comparison means 4 compares the density value of a noticedpicture element with the predetermined threshold level and outputs ablack signal when the density value of the noticed picture element isequal to or higher than the predetermined threshold level. The storagemeans 5 stores a binary value error of a picture element on the oppositeside to the noticed picture element in the main scanning direction orthe sub scanning direction.

The addition means 6 adds, when it is determined by the first comparisonmeans 4 that the density value of the noticed picture element is lowerthan the predetermined threshold level, the binary value error stored inthe storage means 5 to the density value of the noticed picture element.The second comparison means 7 compares the result of addition by theaddition means 6 with the predetermined threshold level and outputs ablack signal when the result of addition is equal to or higher than thepredetermined threshold level. The logical OR gate 8 outputs the resultof logical ORing between the output of the first comparison means 4 andthe output of the second comparison means 7 as a result of binarydigitization processing.

In the image processing method applied to the image processing apparatusdescribed above with reference to FIG. 1, when the binary digitizationmeans 3 tries to effect binary digitization processing wherein densityvalues obtained by the sensor 1 are compared with the predeterminedthreshold level for the individual picture elements by the binarydigitization means 3 to convert each of the density values into one oftwo binary values of white and black, if it is determined by the firstcomparison means 4 that the density value of the noticed picture elementis lower than the predetermined threshold level, the binary value errorof the picture element on the opposite side to the noticed pictureelement in the main scanning direction or the sub scanning directionstored in storage means 5 is added to the density value of the noticedpicture element by the addition means 6.

Then, the sum value obtained by such addition and the predeterminedthreshold level are compared with each other by the second comparisonmeans 7, and when it is determined that the sum value is equal to orhigher than the predetermined threshold level, a black signal isoutputted for the noticed picture element. In this instance, the resultof logical ORing between the output of the first comparison means 4 andthe output of the second comparison means 7 is outputted as a result ofbinary digitization processing of the binary digitization means 3 fromthe logical OR gate 8. Consequently, when one of the output of the firstcomparison means 4 and the output of the second comparison means 7 is ablack signal, a black signal is outputted as a result of binarydigitization processing for the noticed picture element.

Referring now to FIG. 2, there is shown an image processing apparatusaccording to another aspect of the present invention. The imageprocessing apparatus includes a sensor 1 and binary digitization means 3similarly to the image processing apparatus according to the firstaspect of the present invention described above. While the sensor 1 issimilar to that of the image processing apparatus of the first aspect,the binary digitization means 3 includes different components. Inparticular, the binary digitization means 3 of the image processingapparatus of the present aspect includes first comparison means 4, firststorage means 5A, second storage means 5B, first addition means 6A,second addition means 6B, second comparison means 7A, third comparisonmeans 7B, and a logical OR gate 8A.

The first comparison means 4 is quite similar to the first comparisonmeans 4 described hereinabove with reference to FIG. 1. Meanwhile, thefirst storage means 5A and the second storage means 5B store a binaryvalue error of a picture element on the opposite side to a noticedpicture element in a main scanning direction and another binary valueerror of another picture element on the opposite side to the noticedelement in a sub scanning direction, respectively.

The first addition means 6A and the second addition means 6B add, whenit is determined by the first comparison means 4 that the density valueof the noticed picture element is lower than the predetermined thresholdlevel, the binary value errors stored in the first storage means 5A andthe second storage means 5B to the density value of the noticed pictureelement, respectively.

Further, the second comparison means 7A and the third comparison means7B compare the result of addition (first sum value) by the firstaddition means 6A and the result of addition (second sum value) by thesecond addition means 6B with a predetermined threshold level,respectively, and each outputs a black signal when the result ofaddition is equal to or higher than the predetermined threshold level.The logical OR gate 8A outputs the result of logical ORing between theoutput of the first comparison means 4 and the outputs of the secondcomparison means 7A and the third comparison means 7B as a result ofbinary digitization processing of the binary digitization means 3.

It is to be noted that the predetermined threshold level for the secondcomparison means 7A and the threshold level for the third comparisonmeans 7B may have different preset values from each other.

Further, in the apparatus described with reference to FIGS. 1 and 2, thebinary value error is set to "0" when the binary digitization output forthe picture element which has the binary value error is a black signal,but is set to the density value of the picture element before processedby binary digitization processing when the binary digitization outputfor the picture element is a white signal.

In the image processing method on the apparatus of the second aspect ofthe present invention described above with reference to FIG. 2, when itis determined by the first comparison means 4 that the density value ofa noticed picture element is lower than the predetermined thresholdlevel before binary digitization processing wherein density valuesobtained from the sensor 1 are compared with the predetermined thresholdlevel for the individual picture elements by means of the binarydigitization means 3 to convert each of the density values into one oftwo binary values of white and black, a first sum value is firstcalculated by the first addition means 6A by adding a binary value errorof a picture element on the opposite side to the noticed picture elementin the main scanning direction stored in the first storage means 5A tothe density value of the noticed picture element and then the first sumvalue and the predetermined threshold level are compared with each otherby the second comparison means 7A while a second sum value is calculatedby the second addition means 6B by adding another binary value error ofanother picture element on the opposite side to the noticed pictureelement in the sub scanning direction stored in the second storage means5B to the density value of the noticed picture element and then thesecond sum value and the predetermined value are compared with eachother by the third comparison means 7B.

Then, when it is determined by the second comparison means 7A or thethird comparison means 7B that at least one of the first sum value andthe second sum value is equal to or higher than the predeterminedthreshold level, a black signal is outputted for the noticeable pictureelement. In this instance, since the result of logical ORing among theoutput of the first comparison means 4, the output of the secondcomparison means 7A and the output of the third comparison means 7B isoutputted as a result of binary digitization processing of the binarydigitization means 3 from the logical OR gate 8A, when any one of theoutput of the first comparison means 4, the output of the secondcomparison means 7A and the output of the third comparison means 7B is ablack signal, a black signal is outputted as a result of binarydigitization processing for the noticed picture element.

Referring now to FIG. 3, there is shown an image processing apparatusaccording to a further aspect of the present invention. The imageprocessing apparatus includes a sensor 1 similar to that of the imageprocessing apparatus of the first aspect for detecting a density valueof image data for each picture element. The image processing apparatusfurther includes analog to digital conversion means 2 for converting ananalog density value obtained from the sensor 1 into digital densityvalues of a predetermined number of bits for a predetermined conversiondensity range, and binary digitization means 3 for comparing digitaldensity values from the analog to digital conversion means 2 for theindividual picture elements with a predetermined threshold level toconvert each of the digital density values into one of two binary valuesof white and black.

The image processing apparatus further includes histogram productionmeans 10 for producing a histogram from density values of a noticedpicture element and adjacent picture elements around the noticed pictureelements, setting means 12, and modification means 13. The setting means12 sets a conversion density range for the noticed picture element inresponse to a density range of a peak appearing in the histogramproduced by the histogram production means 10.

The modification means 13 converts the digital density value of thenoticed picture element from the analog to digital conversion means 2for the conversion density range set by the setting means 12 intoanother digital density value using a scale obtained by dividing theconversion density range by a number provided by the number of bits bywhich the analog to digital conversion means 2 performs analog todigital conversion. It is to be noted that the modification means 13 canbe constituted from a lookup table which may be used also as a memoryfor γ conversion.

In the image processing method on the image processing apparatus of theaspect of the present invention described above with reference to FIG.3, analog density values obtained from the sensor 1 are converted intodigital density values of the predetermined number of bits for thepredetermined conversion density range by the analog to digitalconversion means 2, and the digital density values thus obtained arecompared with the predetermined threshold level for the individualpicture elements so that they are each converted into one of two binaryvalues of white and black. In this instance, a histogram of the densityvalues of the noticed picture element and the adjacent picture elementsaround the noticed picture element is produced by the histogramproduction means 10 based on the output of the analog to digitalconversion means 2.

Then, the setting means 12 sets a conversion density range for thenoticed picture element in accordance with the density range of a peakappearing in the histogram produced by the histogram production means10. In particular, when the density range of a peak appearing in thehistogram is on the high density side (when image data of black arebeing read), the setting means 12 sets a conversion density range equalto the predetermined conversion density range of the analog to digitalconversion means 2, but when the density range of a peak appearing inthe histogram is on the low density side (when image, data of a colorsuch as red or blue are being read), the setting means 12 sets aconversion density range narrower than the predetermined conversiondensity range and ranging from the density level of the ground color tothe low density level at which the peak appears.

Thereafter, the change-over means 13 converts the digital density valueof the noticed picture element from the analog to digital conversionmeans 2 into a digital density value using the scale obtained bydividing the conversion density range by the number provided by thenumber of bits by which the analog to digital conversion means 2performs analog to digital conversion. In particular, when image data ofa high density are being read, the output of the analog to digitalconversion means 2 is outputted as it is from the change-over means 13,but when image data of a low density are being read, the output of theanalog to digital conversion means 2 is converted into a digital densityvalue by the change-over means 13 using the scale obtained by dividingthe narrow conversion density range by the same predetermined number ofbits as in the case of a high density. The digital density valueobtained by such conversion is outputted from the change-over means 13.

Referring now to FIG. 4, there is shown an image processing apparatusaccording to a still further aspect of the present invention. The imageprocessing apparatus includes a sensor 1, analog to digital conversionmeans 2, binary digitization means 3, and histogram production means 10which are all similar to those of the image processing apparatusdescribed hereinabove with reference to FIG. 3. The image processingapparatus further includes conversion density range setting means 9 forsetting a predetermined conversion density range for the analog todigital conversion means 2, and conversion density range modificationmeans 11 for modifying the predetermined conversion density range set bythe conversion density range setting means 9 in accordance with thedensity range of a peak appearing in the histogram produced by thehistogram production means 10.

The conversion density range setting means 9 may include ground colorlevel setting means 9A for setting an analog density value correspondingto the ground color of image data detected by the sensor 1 as a groundcolor reference level, high density level setting means 9B for settingan analog density value corresponding to high density side image datadetected by the sensor 1 as a high density level reference value, andlow density level setting means 9C for setting an analog density valuecorresponding to low density side image data detected by the sensor 1 asa low density level reference value.

The conversion density range modification means 11 may be constructed aschange-over means for selectively outputting one of the high densitylevel reference value from the high density level setting means 9B andthe low density level reference value from the low density level settingmeans 9C to the analog to digital conversion means 2 in response to thedensity range of a peak appearing in the histogram produced by thehistogram production means 10.

Thus, the predetermined conversion density range for the analog todigital conversion means 2 is set based on the ground color levelreference value from the ground color level setting means 9A and one ofthe high density level reference value from the high density levelsetting means 9B and the low density level reference value from the lowdensity level setting means 9C which has been selected by thechange-over means 11.

In the image processing method on the image processing apparatus of thepresent invention described above with reference to FIG. 4, analogdensity values obtained from the sensor 1 are converted into digitaldensity values of the predetermined number of bits for the predeterminedconversion density range by the analog to digital conversion means 2,and the digital density values thus obtained are compared with thepredetermined threshold level for the individual picture elements sothat they are each converted into one of two binary values of white andblack. Then, a histogram of the density values of the noticed pictureelement and the adjacent picture elements around the noticed pictureelement is produced by the histogram production means 10 based on theoutput of the analog to digital conversion means 2.

It is to be noted that the predetermined conversion density range forthe analog to digital conversion means 2 is set by the conversiondensity range setting means 9. Normally, when image data of blackappearing on paper whose ground color is white are read, the groundcolor level reference value from the ground color level setting means 9Aand the high density level reference value from the high density levelsetting means 98 are inputted to the analog to digital conversion means2, and the range between the ground color level reference value and thehigh density level reference value is set as the predeterminedconversion density range. Consequently, digital density values arecalculated from the density values from the sensor 1 using a scaleobtained by dividing the predetermined conversion density range by anumber provided by the predetermined number of bits and are outputtedfrom the analog to digital conversion means 2.

Then, the conversion density range modification means 11 selectivelychanges over the reference value to be outputted to the analog todigital conversion means 2 between the high density, level referencevalue from the high density level setting means 9B and the low densitylevel reference value from the low density level setting means 9Cinaccordance with the density range of a peak appearing in the histogramproduced by the histogram production means 10.

In particular, when the density range of a peak appearing in thehistogram is on the high density side (when image data of black arebeing read), the high density level reference value from the highdensity level setting means 9B is outputted to the analog to digitalconversion means 2 as in an ordinary case, but when the density range ofa peak appearing in the histogram is on the low density side (when imagedata of red or blue are being read), the high density level referencevalue from the high density level setting means 9B is outputted to theanalog to digital conversion means 2.

Consequently, when image data of a low density are being read, theground color level reference value from the ground color level settingmeans 9A and the low density level reference value from the low densitylevel setting means 9C are inputted to the analog to digital conversionmeans 2, and the range between the ground color level reference valueand the low density level reference value is set as the predeterminedconversion density range. Then, digital density values obtained usingthe scale obtained by dividing the predetermined conversion densityrange by the number provided by the same predetermined number of bits asthat in the case of a high density are outputted to the analog todigital conversion means 2.

In this manner, with the image processing methods and the imageprocessing apparatus of the aspects of the present invention describedabove, since, when the density value of a noticed picture element islower than the predetermined threshold level, a binary value error of apicture element on the opposite side to the noticed picture element inthe main scanning direction or the sub scanning direction is added tothe density value of the noticed picture element and a sum valueobtained by such addition is compared with the predetermined thresholdlevel to effect determination between two binary values of white andblack in order to restore the density value of a thin line which havebeen divided into two picture elements, a possible drop or break of athin line which is caused by a little inclination of an original can beprevented with certainty by a simple processing procedure withoutemphasizing noise.

Further, with the image processing methods and the image processingapparatus of the aspects of the present invention described above, sincethe density conversion range for the analog to digital conversion means2 is suitably modified in accordance with the density range of a peak inthe histogram obtained by the histogram production means 10, even whenimage data of a document image or a like image in which two or morecolors are used are read as a binary image of white and black(particularly when color characters are present discretely in adocument), sharp binary digitization processing which does not causeblurring or distortion can be achieved advantageously.

b. First Embodiment

FIG. 5 shows an image processing apparatus to which an image processingmethod according to the present invention is applied. Referring to FIG.5, the image processing apparatus shown includes a CCD element (sensor)1A for scanning an original not shown in a main scanning direction and asub scanning direction to detect density values for individual pictureelements of image data, an analog to digital converter 2A for convertingthe analog density values obtained from the CCD element 1A into digitaldensity values of a predetermined number of bits for a predeterminedconversion density range, and a binary digitization circuit 3A servingas binary digitization means for comparing the digital density valuesfrom the analog to digital converter 2A for the individual pictureelements with a predetermined threshold level to convert them each intoone of two binary values of white and black.

The binary digitization circuit 3A includes a pair of latch circuits(LAT) 30 and 32, three comparators (CMP) 31, 34 and 38, a pair of adders(ADD) 33 and 37, a selector (SEL) 35, a FIFO (First-In First-Out) memory36, a pair of logical OR gates 39 and 41, a pair of NOT (invertor) gates40 and 42, a logical AND gate 43, and a serial to parallel converter(S-P) 44.

The latch circuit 30 latches a video input (digital density valuesincluding a digital density value x_(i),j of a noticed picture element,refer to FIG. 6) inputted thereto from the analog to digital converter2A in synchronism with a video clock signal.

The comparator 31 serves as first comparison means and compares thedigital density value x_(i),j of the noticed picture element latched bythe latch circuit 30 with a predetermined threshold level Th. Then, thecomparator 31 outputs a black signal (H (high) level signal) when thedigital density value x_(i),j is equal to or higher than thepredetermined threshold level Th, but outputs a white signal (L (Low)level signal) when the digital density value x_(i),j is lower than thepredetermined threshold level Th.

The latch circuit 32 serves as first storage means and latches a digitaldensity value from the latch circuit 30 to store a binary value errore_(i-1),j of a picture element on the opposite side to the noticedpicture element in the main scanning direction.

Here, the binary value error e_(i-1),j is set, when the binarydigitization output of the last noticed picture element is a blacksignal (H level signal), to zero since a clear signal (H level signal)is inputted to a clear terminal (CLR) of the latch circuit 32 by way ofan inversion element 32a through the OR gate 39 and the NOT gate 40 sothat the data (digital density value x_(i-1),j of the last noticedpicture element) of the latch circuit 32. On the other hand, when thebinary digitization output of the last noticed picture element is awhite signal (L level signal), the latch circuit 32 is not cleared andthe binary value error e_(i-1),j is set to the digital density valuex_(i-1),j of the last noticed picture element (that is, the digitaldensity value of the picture element on the opposite side to the presentnoticed picture element in the main scanning direction, refer to FIG.6).

The adder 33 serves as first addition means and adds the binary valueerror e_(i-1),j stored in the latch circuit 32 to the digital densityvalue x_(i),j of the noticed picture element. Then, the adder 33 outputsa sum value obtained by such addition as a first sum value.

The comparator 34 serves as second comparison means and compares theresult of addition (first sum value) of the adder 33 with thepredetermined threshold level Th. Then, the comparator 34 outputs ablack signal (H level signal) when the first sum value is equal to orhigher than the predetermined threshold level Th, but outputs a whitesignal (L level signal) when the first sum value is lower than thepredetermined threshold level Th.

The selector 35 outputs, when the binary digitization output of thepresent noticed picture element is a black signal (H level signal), "0"as a binary value error e_(i),j of the present noticed picture elementto the FIFO memory 36 at the next stage since an L level signal isinputted to a change-over terminal (SEL) of the selector 35 by way ofthe OR gate 89 and the NOT gate 40, but outputs, when the binarydigitization output of the present noticed picture element is a whitesignal (L level signal), the digital density value x_(i),j of thepresent noticed picture element latched in the latch circuit 30 as abinary value error e_(i),j of the present noticed picture element to theFIFO memory 36 at the next stage since an H level signal is inputted tothe change-over terminal of the selector 35 by way of the OR gate 39 andthe NOT gate 40.

The FIFO memory 36 serves as second storage means and stores the binaryvalue error e_(i),j of the present noticed picture element from theselector 35 and outputs a binary value error e_(i),j-1 of a pictureelement in the last row delayed by a time for one main scanning periodfrom the present noticed picture element (that is, the picture elementon the opposite side to the noticed picture element in the sub scanningdirection) in synchronism with the video clock signal.

The binary value error e_(i),j-1 is set to "0" by the function of theselector 35 described above when the binary digitization output of thenoticed picture element in the last row delayed by a time for one mainscanning period is a black signal (H level signal), but is set to thedigital density value x_(i),j-1 of the noticed picture element in thelast row delayed by a time for one main scanning period, that is, thedigital density value of the picture element on the opposite side to thenoticed picture element in the sub scanning direction (refer to FIG. 6),when the binary digitization output of the noticed picture element inthe last row delayed by the time for one main scanning period is a whitesignal (L level signal).

The adder 37 serves as second addition means and adds the binary valueerror e_(i),j-1 outputted from the FIFO memory 36 to the digital densityvalue x_(i),j of the noticed picture element. The adder 37 then outputsa value obtained by such addition as a second sum value.

The comparator 38 serves as third comparison means and compares theresult of addition (second sum value) of the adder 37 with thepredetermined threshold level Th. Then, the comparator 38 outputs ablack signal (H level signal) when the second sum value is equal to orhigher than the predetermined threshold level Th, but outputs a whitesignal (L level signal) when the second sum value is lower than thepredetermined threshold level Th.

The OR gate 39 outputs the result of logical ORing between the output ofthe comparator 31 and the output of the AND gate 43 (which is the resultof logical ORing by the OR gate 41 between the outputs of the comparator34 and the comparator 38) as a result of binary digitization processingof the binary digitization circuit 3A.

The NOT gate 40 inverts the output of the OR gate 39, which is theresult of binary digitization processing for the present noticed pictureelement, and outputs a resulted signal to the inversion element 32a(clear terminal CLR) of the latch circuit 32 and the change-overterminal (SEL) of the selector 35 as described above.

The OR gate 41 outputs the result of logical ORing between the output ofthe comparator 34 and the output of the comparator 38, and the NOT gate42 inverts the output of the comparator 31 and outputs a resultedsignal.

The AND gate 43 outputs the result of logical ANDing between the outputof the NOT gate 42 and the output of the OR gate 41 so that the resultof logical ORing from the OR gate 41 is outputted to the OR gate 39 onlywhen the output of the NOT gate 42 is an H level signal, that is, whenit is determined by the comparator 31 that the digital density valuex_(i),j of the noticed picture element is lower than the predeterminedthreshold level Th.

The serial to parallel converter 44 converts the result of binarydigitization processing (a binary signal of white or black) in the formof a serial signal from the OR gate 39 into a parallel signal of asuitable length, for example, 8 bits=1 byte and outputs the parallelsignal.

In the following, operation of the binary digitization circuit 3Aconstructed in such a manner as described above will be described withreference to processing steps S1 to S9 of FIG. 7. It is to be notedthat, while processing based on the result of comparison by thecomparator 34 and processing based on the result of comparison by thecomparator 38 are performed successively in order, in the apparatus ofthe construction shown in FIG. 5, such processes are performedparallelly as they are performed by separate hardware constructions.

Referring to FIG. 7, image data (digital density values) detected by theCCD element 1A and converted into digital values by the analog todigital converter 2A are inputted to and latched by the latch circuit 30in synchronism with the video clock signal so that they are synchronizedwith the video clock signal.

A digital density value x_(i),j of a noticed picture element inputted tothe latch circuit 30 is compared with the predetermined threshold levelTh by the comparator 31 (step S1), and then when it is determined thatthe digital density value x_(i),j of the noticed picture element isequal to or higher than the predetermined threshold level Th, a blacksignal (H level signal: an output flag F=1) is outputted as a result ofbinary digitization processing from the comparator 31 and introduced tothe serial to parallel converter 44 by way of the OR gate 39 (step S2).

After the black signal (H level signal) is outputted as a result ofbinary digitization processing from the OR gate 39, a clear signal (Hlevel signal) is inputted to the clear terminal of the latch circuit 32by way of the inversion element 32a via the OR gate 39 and the NOT gate40, and the digital density value x_(i),j of the present noticed pictureelement is not latched by the latch circuit 32, but "0" is latched andset as a binary value error e_(i),j of the present noticed pictureelement by the latch circuit 32 (step S3). At the same time, an L levelsignal is inputted to the change-over terminal of the selector 35 by wayof the OR gate 39 and the NOT gate 40, and consequently, "0" isoutputted as the binary value error e_(i),j of the present noticedpicture element from the-selector 35 to the FIFO memory 36 at the nextstage (step S3).

On the other hand, if it is determined by the comparator 31 that thedigital density value x_(i),j of the noticed picture element is equal toor higher than the predetermined threshold level Th, a white signal (Llevel signal) is outputted from the comparator 31. Since the L levelsignal is inverted by the NOT gate 42 and inputted as an H level signalto the AND gate 43, it is enabled to output the result of logical ORingof the OR gate 41 as a result of binary digitization processing from theAND gate 43.

Then, the adder 33 adds a binary value error e_(i-1),j, that is, abinary value error of a picture element on the left side of the noticedpicture element in FIG. 6, stored in the latch circuit 32 to the digitaldensity value x_(i),j of the noticed picture element (step S4), and thenthe adder 37 adds another binary value error e_(i),j-1 outputted fromthe FIFO memory 36, that is, a binary value error of a picture elementin the last row to the noticed picture element in FIG. 6, to the digitaldensity value x_(i),j of the noticed picture element (step S6). Sumvalues obtained by such addition are outputted as a first sum valuex_(h) and a second sum value x_(v).

The sum values x_(h) and x_(v) by the adder 33 and the adder 37 arecompared with the predetermined threshold level Th by the comparator 34and the comparator 38 (steps S5 and S7), respectively, and if it isdetermined by either one of the comparator 34 and the comparator 38 thatthe sum value x_(h) or x_(v) is equal to or higher than thepredetermined threshold level Th, a black signal (H level signal: theoutput flag F=1) is outputted from a corresponding one of the comparator34 and the comparator 38. The black signal is introduced as a result ofbinary digitization processing to the serial to parallel converter 44 byway of the OR gate 41, the AND gate 43 and the OR gate 39 (step S2).

Simultaneously, "0" is latched and set as a binary value error e_(i),jof the present noticed picture element by the latch circuit 32, and an Llevel signal is inputted to the change-over terminal of the selector 35by way of the OR gate 39 and the NOT gate 40. Consequently. "0" isoutputted as the binary value error e_(i),j of the present noticedpicture element to the FIFO memory 36 at the next stage.

On the other hand, if it is determined as a result of comparison betweenthe sum values x_(h) and x_(v) from the adder 33 and the adder 37 andthe predetermined threshold level Th by the comparator 34 and thecomparator 38, respectively, that both of the sum values x_(h) and x_(v)are lower than the predetermined threshold level Th, a white signal (Llevel signal) is outputted from both of the comparator 34 and thecomparator 38. Consequently, both of the OR gate 41 and the AND gate 43output an L level signal, and accordingly, also the result of binarydigitization processing outputted from the OR gate 39 becomes a whitesignal (L level signal; the output flag F=0). The white signal isintroduced to the serial to parallel converter 44 (step S8).

When the white signal (L level signal) is outputted as a result ofbinary digitization processing from the OR gate 39, the signal to besent to the clear terminal of the latch circuit 32 by way of the NOTgate 40 becomes an L level signal, and consequently, the digital densityvalue x_(i),j of the present noticed picture element is latched and setas the binary value error e_(i),j of the noticed picture element of thepresent cycle by the latch circuit 32 (step S9). At the same time, an Hlevel signal is inputted to the change-over terminal selector 35 by wayof the NOT gate 40, and consequently, the digital density value x_(i),jof the present noticed picture element is outputted as the binary valueerror e_(i),j of the noticed picture element of the present cycle to theFIFO memory 36 at the next stage (step S9).

In this manner, according to the first embodiment of the presentinvention, a density value x_(i),j of a noticed picture element is firstcompared with the threshold level Th, and if the density value x_(i),jis equal to or higher than the threshold level Th, it is determined thatthe notice picture element is black and the binary value error e_(i),jof the noticed picture element is set to "0".

On the other hand, if the density value x_(i),j of the noticed pictureelement is lower than the threshold level Th, a first sum value x_(h)obtained by addition of a binary value error e_(i-1),j of a pictureelement on the left side of the noticed picture element in FIG. 6 to thedensity value x_(i),j and a second sum value x_(v) obtained by additionof another binary value error e_(i),j-1 of another picture element inthe last row to the noticed picture element in FIG. 6 to the densityvalue x_(i),j are individually compared with the threshold level Th, andif either one of the first and second sum values x_(h) and x_(v) isequal to or higher than the threshold level Th, then it is determinedthat the noticed picture element is black and simultaneously the binaryvalue error e_(i),j of the noticed picture element is set to "0".

On the other hand, when both of the first sum value x_(h) and the secondsum value x_(v) are lower than the threshold level Th, it is determinedthat the noticed picture element is white and simultaneously the densityvalue x_(i),j is set as the binary value error e_(i),j of the noticedpicture element.

Due to such processing as described above, even if it is determined thateither one of two picture elements spanned by a thin line as shown inFIG. 8 is white, since the density value based on which thedetermination of white has been made is added or distributed to one oftwo downward and rightward adjacent picture elements as a binary valueerror, a drop or break of the thin line which may be caused by a littleinclination of the original can be prevented with certainty by a simpleprocessing procedure without emphasizing noise.

Meanwhile, when it is intended to achieve the image processing methodwith hardware construction, the hardware construction can be realizedwithout a delay with a smaller amount of circuitry than that of aconventional construction which is achieved by binary digitizationprocessing. Accordingly, the present invention contributes very much toenhancement of the functions of an image processing apparatus.

It is to be noted that, while, in the embodiment described above, bothof binary value errors of a picture element on the opposite side to anoticed picture element in the main scanning direction and anotherpicture element on the opposite side to the noticed picture element inthe sub scanning direction are added to a density value of the noticedpicture element, only one of the binary value errors of the pictureelement on the opposite side of the noticed picture element in the mainscanning direction and the picture element on the opposite side of thenoticed picture element in the sub scanning direction may be added tothe density value of the noticed picture element. Also in this instance,similar advantages to those of the embodiment described above can beachieved.

Further, while, in the embodiment described above, the comparator 31,the comparator 34 and the comparator 38 have the same predeterminedthreshold level Th, particularly the threshold level for the comparator34 and the threshold level for the comparator 38 may be set differentfrom each other. The first sum value obtained by addition of the errorinformation of the picture element-on the opposite side (on the leftside) to the noticed picture element in the main scanning direction tothe density value of the noticed picture element is comparatively liableto become so high that it exceeds the threshold level, and accordingly,it is desirable that, taking such liability into consideration, thethreshold level for the comparator 34 be set higher than the thresholdlevel for the comparator 38.

c. Second Embodiment

FIG. 9 shows an image processing apparatus to which another imageprocessing method according to the present invention is applied. In thepresent embodiment, a two-color original whose ground color is white andon which data such as characters are written in black and red is read.

Referring to FIG. 9, the image processing apparatus shown includes a CCDelement 1A serving as a sensor, an analog to digital converter 2Aserving as analog to digital conversion means, and a binary digitizationcircuit 3A serving as binary digitization means. The CCD element 1Ascans an original not shown in a main scanning direction and a subscanning direction to detect density values for individual pictureelements of image data from light reflected from the image data. Theanalog to digital converter 2A receives the analog density valuesobtained from the CCD element 1A by way of an amplifier 50 and a samplehold circuit 51 and converts the analog density values into digitaldensity values of a predetermined number of bits for a predeterminedconversion density range. The binary digitization circuit 3A comparesthe digital density values received from the analog to digital converter2A by way of a lookup table 58 and some other circuit, which will behereinafter described, for the individual picture elements with apredetermined threshold level to convert the digital density values eachinto one of two binary values of white and black.

The image processing apparatus further includes a conversion densityrange setting section 52 for setting a predetermined conversion densityrange for the analog to digital converter 2A. The conversion densityrange setting section 52 includes a white level setting section 53serving as ground color level setting means for setting an analogdensity value (minimum reference voltage value) corresponding to thewhite (ground color of an original which is an object for reading of animage) of image data detected by the CCD element 1A as a white levelreference value (white reference), and a black level setting section 54serving as high density level setting means for setting an analogdensity value (maximum reference voltage value) corresponding to highdensity side image data (in the present embodiment, a black character)detected by the CCD element 1A as a black level reference value (blackreference).

The white level setting section 53 includes a white level follower 53Afor following the white, which is the ground color of an actualoriginal, in accordance with digital density values obtained by the CCDelement 1A and the analog to digital converter 2A to correct the whitelevel reference value, and a digital to analog converter 53B forconverting the digital output of the white level follower 53A into ananalog value (voltage value) and outputting the analog value to theanalog to digital converter 2A. Similarly, the black level settingsection 54 includes a black level follower 54A for following the blackof black characters on an actual original in accordance with digitaldensity values obtained from the CCD element 1A and the analog todigital converter 2A to correct the black level reference value, and adigital to analog converter 54B for converting the digital output of theblack level follower 54A into an analog value (voltage value) andoutputting the analog value to the analog to digital converter 2A.

It is to be noted that a section including the CCD element 1A, theamplifier 50, the sample hold circuit 51, the analog to digitalconverter 2A, and the conversion density range setting section 52described above is similar to a quantizer which is employed in popularimage scanners while a conversion maximum value level and a conversionminimum value level of the analog to digital converter 2A are determinedby the white level setting section 53 and the black level settingsection 54 described above, respectively, and quantization (digitalconversion) with a predetermined number of bits (8 bits in the presentembodiment) is performed by the analog to digital converter 2A for aconversion density range defined by those levels. In the presentembodiment, conversely to the first embodiment described hereinabove,the output of the analog to digital converter 2A exhibits the value 0when the density value is equal to the reference value of black, butexhibits the value 255 when the density value is equal to the referencevalue of white as hereinafter described with reference to FIGS. 11 to13.

The image processing apparatus further includes five, latch circuits 55Ato 55E each capable of successively latching five 8-bit data (data for 5bytes, which are digital density values for individual pictureelements), and four line memories 56A to 56D for successively delayingand sending out five 8-bit data to the latch circuits 55B to 55E,respectively. A matrix of 5×5 digital density values centered at anoticed picture element is formed by the latch circuits 55A to 55E andthe line memories 56A to 58D. It is to be noted that, while the fourline memories 56A to 56D have a memory capacity for one main scanningminus 5 bytes, such data for 5 bytes are compensated for by the latchcircuit 55A.

The image processing apparatus further includes a frequency valuedetector 57 serving as histogram production means for producing ahistogram of density values of a noticed picture element and pictureelements around the noticed picture element using the factors of thematrix of the digital density values latched in the latch circuits 55Ato 55E. Detailed construction of the frequency value detector 57 will behereinafter described with reference to FIG. 10.

The image processing apparatus further includes a lookup table 58serving as setting means and conversion means. In particular, the lookuptable 58 functions as setting means for setting a conversion densityrange for a noticed picture element in accordance with the density rangeof a peak appearing in the histogram produced by the frequency valuedetector 57 (that is, density values of a first peak and a second peakwhich will be hereinafter described with reference to FIGS. 12 and 13).Further, the lookup table 58 converts the digital density value of thenoticed picture element from the analog to digital converter 2A (in thepresent embodiment, data latched at the center of the latch circuit 55C)into another digital density value using a scale obtained by dividingthe conversion density range set by the function of the lookup table 58as the setting means by a number provided by the equal bit number (8bits in the present embodiment) to the conversion bit number by theanalog to digital converter 2A. It is to be noted that, in the presentembodiment, the lookup table 58 is constituted from a memory which isnormally used as a memory for γ conversion.

Referring now to FIG. 10, the frequency value detector 57 includes acounter 60, n registers 61-1 to 61-n, a pair of comparators 62A and 62B,an AND gate 63, and a peak detection section 64.

The registers 61-1 to 61-n are provided for divisional ranges obtainedby dividing a predetermined conversion density range of the analog todigital converter 2A by n and store upper limit values Ui (i=1 to n) andlower limit values Di (i-1 to n) of the divisional ranges andfrequencies Fi (i=1 to n) of density values which belong to theindividual divisional ranges.

The comparators 62A and 62B compare the upper limit value Ui and thelower limit value Di read out from one of the registers 61-1 to 61-n inresponse to a count signal of the counter 60 each time a factor of amatrix of 5×5 digital density values is inputted with the inputteddensity value, respectively. The comparator 62A outputs a high levelwhen the input density value is equal to or lower than the upper limitvalue Ui, and the comparator 62B outputs a high level when the inputdensity value is equal to or higher than the lower limit value Di.

The AND gate 63 outputs the result of logical ANDing between the outputsof the comparators 62A and 62B. In particular, when both of the outputsof the comparators 62A and 62B exhibit a high level, that is, when adivisional range to which the input density value belongs is determined,the AND gate 63 outputs a high level and increments one of thefrequencies F1 to Fn of the registers 61-1 to 61-n for the divisionalregion by one. For example, when it is determined by the comparators 62Aand 62B that the input density value is equal to or lower than the upperlimit value Ui and equal to or higher than the lower limit value Di, theoutput of the AND gate 63 exhibits a high level and the frequency Fi ofthe register 61-i is incremented by one.

The peak detection section 64 detects, after determination to which oneof the divisional ranges the input density value belongs is completedfor all of the factors of a matrix of 5×5 digital density values, aregister number of one of the frequencies F1 to Fn stored in theregisters 61-1 to 61-n which makes a peak, and outputs the registernumber, that is, the density range of the peak appearing in thehistogram. Here, the peak detection section 64 in the present embodimentdetects and outputs both of a density range of a first peak (densityrange of the ground color) and another density range of a second peak(density range of black or red).

Before operation of the image processing apparatus of the secondembodiment having such a construction as described above is described, afactor of occurrence of blurring or distortion upon reading of atwo-color original and the principle in reading a two-color originalsharply with the image processing apparatus of the present embodimentwill be described with reference to FIGS. 11 to 13.

FIG. 11 is a graph showing a general CCD output when a ground color, ared character and a black character are read. When no incident light isinputted to the CCD element 1A at all, the CCD output voltage value is,for example, 5 V, and when light is inputted to the CCD element 1A, theCCD output voltage value fails from 5 V. Then, when white which is theground color of the original is read in as indicated at a portion (a) inFIG. 11, the CCD output voltage value exhibits a minimum value. Thevoltage value then is followed and held as a minimum reference voltagevalue by the white level setting section 53 to set a white reference.

On the other hand, the CCD output voltage value when black is read inbecomes almost close to 5 V which is the maximum voltage value as seenfrom a portion (d) of FIG. 11, and the maximum voltage value is followedand held as a maximum reference voltage value by the black level settingsection 54 to set a black reference.

Since an actual analog to digital conversion input signal is inverted,where an analog to digital converter of 8 bits is used for the analog todigital converter 2A, when the output of the analog to digital converter2A is 0, the color read is black, but when the output is 255, the colorread is white. Processing based on the output of the analog to digitalconverter 2A of such construction will be described below.

When a black character is read In actually, the output of the analog todigital converter 2A does not exhibit the full value of 0 as seen from aportion (c) in FIG. 11, but exhibits a considerably low level.Accordingly, if the threshold level for the binary digitization circuit3A is normally set to 128, then the output of the analog to digitalconverter 2A for a black character exhibits a level lower than thethreshold level and accordingly is determined as black.

However, If a red character is read in, the output of the analog todigital converter 2A exhibits little drop as seen from another portion(b) in FIG. 11 and has a level close to the threshold level for thebinary digitization circuit 3A. Consequently, the result of binarydigitization processing by the binary digitization circuit 3A exhibitsfrequent reversal between white and black, resulting in occurrence ofblurring. Although a possible measure to cope with such blurring is toset the threshold level for the binary digitization circuit 3Acomparatively low, if the threshold level is low, now a black characterwill be read in in a distorted condition. The cause of occurrence ofsuch blurring of a red character or distortion of a black characterresides in the fact that the black reference which is used upon readingof a black character is used commonly for reading of a red character.

Therefore, in the present invention, the density conversion range fordigital density values by the analog to digital converter 2A is changedover depending upon whether a black character is read or a red characteris read so that sharp image reading which does not cause blurring of ared character or distortion of a black character can be achieved while acommon threshold level is used for both of a black character and a readcharacter by the binary digitization circuit 3A.

FIGS. 12 and 13 are graphs showing examples of a histogram of densityvalues when a black character and a red character are read using whiteand black references. When a black character appearing on an originalhaving a white ground color is read, the histogram produced in thefrequency value detector 57 is such as shown in FIG. 12 wherein a firstpeak appears at a portion corresponding to a density range of white anda second peak (peak of a black character) appears at another portioncorresponding to another density range of black. In contrast, when a redcharacter appearing on an original having a white ground color is redin, the histogram produced in the frequency value detector 57 is such asshown in FIG. 13 wherein a first peak appears at a portion correspondingto a density range of white and a second peak (peak of a red character)appears at another portion corresponding to a density range of red (inthe proximity of the digital density value of 128 in FIG. 13).

In the present embodiment, a first peak and a second peak of a histogramfrom a matrix of 5×5 digital density values centered at a noticedpicture element are found by the frequency value detector 57, and theconversion density range of the analog to digital converter 2A ischanged to a suitable one depending upon whether the density range towhich one of the first peak and the second peak belongs coincides withthe density range of black or the density range of red.

In particular, when the density range to which one of the first peak andthe second peak belongs is the black area, the output of the analog todigital converter 2A is used as it is. However, when the density rangeto which one of the first peak and the second peak belongs is the redarea, the output of the analog to digital converter 2A is converted intoa digital conversion value by means of the lookup table 58 byquantization using a scale obtained by dividing the range from the lowerlimit value of the density range of red to the upper limit value of thedensity range of white by a number provided by 8 bits.

In this manner, in the second embodiment of the present invention, whenthe density range of a peak of the histogram detected by the frequencyvalue detector 57 is the black area (when black image data are beingread), the digital density value from the analog to digital converter 2Ais outputted as it is as a density value of the noticed picture elementto the binary digitization circuit 3A.

In contrast, when the density range of the peak in the histogramdetected by the frequency value detector 57 is a red area (when redimage data are being read), a conversion density range corresponding tothe density range of red described above and narrower than the ordinaryconversion density range is set, and the digital density value of thenoticed picture element from the analog to digital converter 2A isconverted into another digital density value by quantization with 8 bitsusing the scale for the conversion density range for red by the lookuptable 58. The digital conversion value obtained by such conversion Isoutputted to the binary digitization circuit 3A.

Accordingly, even when image data of a document image or the like onwhich two or more colors are used is read as a binary image of white andblack, and particularly when color characters are present discretely onthe document, sharp binary digitization processing which does not causeblurring or distortion can be achieved by modifying the conversiondensity range in response to the color of the image for an object ofreading. Accordingly, the effect of the automatic binary digitizationmethod can be anticipated also for colored characters.

Further, since a color scanner need not be used for a small number ofcolor characters, particularly where a high speed operation and a highcompression ratio are required In electronic filing or the like, anordinary monochromatic scanner can be used. This contributes very muchto reduction of the cost.

It is to be noted that, while, in the embodiment described above, theoutput of the analog to digital converter 2A is converted by means ofthe lookup table 58 when the density range of a peak corresponds to ared area, such conversion processing may alternatively be performeddirectly by calculation without using a lookup table. In this instance,the following equation (2) is used as a conversion equation:

    Y=|X-R.sub.PEAK |*[255/(255-R.sub.PEAK)] (2)

where Y is the digital density value after conversion, X is the digitaldensity value outputted from the analog to digital converter 2A, andR_(PEAK) is the digital density value when the red reference isconverted by the analog to digital converter 2A.

Further, while, in the embodiment described above, it is described thata two-color original including a black character and a red character isread, where the original includes some other color than red, such as forexample, blue image data, similar advantages to those of the embodimentdescribed above can be achieved by setting a conversion density rangeconforming to the image data of blue and converting the output of theanalog to digital converter 2A in accordance with the conversion densityrange using a lookup tables or some other suitable means.

Furthermore, in the embodiment described above, it may be added as arequirement for determination of the density range of a peak as a redarea by the frequency value detector 57 that a peak value (frequencyvalue) which belongs to the density range of red exceeds a predeterminedfrequency.

d. Third Embodiment

FIG. 14 shows an image processing apparatus to which a further imageprocessing method according to the present invention is applied.Referring to FIG. 14, the image processing apparatus shown includes aCCD element (CCD) 1A, an amplifier (AMP) 50, a sample hold circuit (S/H)51, an analog to digital converter (A/D) 2A and a frequency valuedetector 57 similar to those of the image processing apparatus describedhereinabove with reference to FIG. 9. Further, though not shown, theimage processing apparatus further includes a binary digitizationcircuit similar to the binary digitization circuit 3 shown in FIG. 9.Since the components mentioned above are similar to those of FIG. 9,overlapping description thereof is omitted herein to avoid redundancy.

The image processing apparatus further includes a density conversionrange setting section 70 serving as density conversion range settingmeans for setting a predetermined conversion density range for theanalog to digital converter 2A. The density conversion range settingsection 70 includes a white level setting section 53 serving as groundcolor level setting means, a black level setting section 54 serving ashigh density level setting means, and a red level setting section 71serving as low density level setting means. The white level settingsection 53 and the black level setting section 54 are quite similar tothose of the white level setting section 53 and the black level settingsection 54 described hereinabove in connection with the secondembodiment of the present invention with reference to FIG. 9,respectively, and overlapping description of them is omitted herein toavoid redundancy. The red level setting section 71 sets an analogdensity value (a density value corresponding to the red reference ofFIG. 11 or 13) for low density side image data detected by the CCDelement 1A as a red level reference value (red reference).

It is to be noted that also the red level setting section 71 mayinclude, similarly to the white level setting section 53 or the blacklevel setting section 54, a red level follower for following the red onan actual original from the analog to digital converter 2A to correctthe red level reference value, and a digital to analog converter forconverting a digital output of the red level follower into an analogvalue (voltage value) and outputting the analog value to the analog todigital converter 2A.

The image processing apparatus further includes a change-over section 72serving as conversion density range modification means or change-overmeans for modifying the predetermined conversion density range set bythe density conversion range setting section 70 in accordance with thedensity range of a peak appearing in a histogram produced by thefrequency value detector 57. The change-over section 72 selects one ofthe black level reference value from the black level setting section 54and the red level reference value from the red level setting section 71in response to the density range of a peak appearing in the histogramproduced by the frequency value detector 57 and outputs the selectedreference value to the analog to digital converter 2A.

Consequently, the predetermined conversion density range for the analogto digital converter 2A is set in accordance with the white levelreference value from the white level setting section 53 and one of theblack level reference value from the black level setting section 54 andthe red level reference value from the red level setting section 71selected by the change-over section 72.

Further, in the analog to digital converter 2A of the presentembodiment, digital conversion is performed twice for the period of oneCCD clock: digital conversion for the first time is performed based onthe black reference from the black level setting section 54, and digitalconversion for the second time is performed based on the red referencefrom the red level setting section 71.

The image processing apparatus further includes a pair of line memories73A and 73B for storing only the output of the analog to digitalconverter 2A when the black reference is selected. The line memory 73Aand the line memory 73B perform writing/reading exclusively for each onescanning.

The image processing apparatus further includes a 15-stage latch circuit74 for alternately latching data written in the line memories 73A and73B and outputting the latched data to the frequency value detector 57.The number of steps of 15 has no special meaning, and the 15-stage latchcircuit 74 may only have no excessive storage capacity. A histogram isproduced from the data latched by the 15-stage latch circuit 74 (digitaldensity value data for the last line) by the frequency value detector 57to detect the density range of a peak similarly as in the secondembodiment.

In the image processing apparatus of the present third embodiment havingthe construction described above, when the density range of a peak inthe histogram detected by the frequency value detector 57 is a blackarea (when black image data are being read), the black level referencevalue from the black level setting section 54 is outputted to the analogto digital converter 2A by way of the change-over section 72, but whenthe density range of the peak In the histogram detected by the frequencyvalue detector 57 is a red area (when red image data are being read),the change-over section 72 is changed over so that the red levelreference value from the red level setting section 71 is now outputtedto the analog to digital converter 2A, similarly as in the secondembodiment.

Consequently, when red image data are being read, the white levelreference value from the white level setting section 53 and the redlevel reference value from the red level setting section 71 are inputtedto the analog to digital converter 2A, and the range between the whitelevel reference value and the red level reference value is set as thepredetermined conversion density range. A digital density value is thusobtained using a scale obtained by dividing the predetermined conversiondensity range by a number provided a predetermined number of bits (8bits in the present embodiment) equal to that used for reading of ablack character and is outputted from the analog to digital converter 2Ato the binary digitization circuit 3A.

In this manner, with the image processing apparatus of the thirdembodiment of the present invention, when the density range of a peak inthe histogram detected by the frequency value detector 57 is a red area,this is fed back to the change-over section 72 to change over theapplicable reference, which has been inputted to the analog to digitalconverter 2A. from the black reference to the red reference.Consequently, when image data such as a character as an object forreading are red, a multi-value output of a density value is providedwith reference to red, and even when color characters are presentdiscretely in the original, sharp binary digitization processing whichdoes not cause blurring or distortion can be performed. Consequently,the effect of automatic binary digitization method can be anticipatedalso for colored characters.

Further, since the image processing apparatus of the third embodimentdoes not require, different from the image processing apparatus of thesecond embodiment described hereinabove, such conversion means as alookup table, it is advantageous in that the bit accuracy can bemaintained and the construction is simplified comparing with theconstruction in the second embodiment and besides a high speed operationcan be achieved.

It is to be noted that, while, in the embodiment described above,reading of a two-color original including a black character and a redcharacter is described, where, for example, blue image data are involvedin addition to red image data, similar advantages to those of theembodiment described above can be achieved by constructing the imageprocessing apparatus such that a level reference value for blue imagedata is set and outputted to the analog to digital converter 2A in placeof the black reference.

Further, while, in the image processing apparatus of the second andthird embodiments described above, the black level setting section 54including the black level follower 54A for following black characters onan actual original to correct and set the black reference and thedigital to analog converter 54B is used in order to set the blackreference, a black level setting section which is constructed to storeand hold a black level reference value (black reference) used forreading a black reference plate may be used for such black level settingsection.

The present invention is not limited to the specifically describedembodiment, and variations and modifications may be made withoutdeparting from the scope of the present invention.

What is claimed is:
 1. An image processing method wherein analog densityvalues obtained from a sensor, which detects a density value of imagedata for each picture element, are converted into digital density valuesby analog to digital conversion means, which converts analog densityvalues obtained from said sensor into digital density values of a fixednumber of bits for a conversion density range, and the digital densityvalues thus obtained are compared for the individual picture elementswith a threshold level to convert each of the digital density valuesinto one of two binary values of white and black, comprising the stepsof:producing a histogram of density values of a noticed picture elementand picture elements around the noticed picture element: setting aconversion density range for the noticed picture element in response toa density range of a peak appearing in the histogram: and converting adigital density value of the noticed picture element from said analog todigital conversion means into another digital density value using ascale obtained by dividing the set conversion density range by a numberprovided by the fixed number of bits.
 2. An image processing methodwherein analog density values obtained from a sensor, which detects adensity value of image data for each picture element, are converted Intodigital density values by analog to digital conversion means, whichconverts analog density values obtained from said sensor into digitaldensity values of a fixed number of bits for a conversion density range,and the digital density values thus obtained are compared for theindividual picture elements with a threshold level to convert each ofthe digital density values into one of two binary values of white andblack, comprising the steps of:producing a histogram of density valuesof a noticed picture element and picture elements around the noticedpicture element; modifying the conversion density range of said analogto digital conversion means in response to a density range of a peakappearing in the histogram; and converting, by said analog to digitalconversion means, an analog density value of the noticed picture elementinto a digital density value using a scale obtained by dividing themodified conversion density range by a number provided by the fixednumber of bits.
 3. An image processing apparatus, comprising:a sensorfor detecting a density value of image data for each picture element:analog to digital conversion means for converting analog density valuesobtained from said sensor into digital density values of a fixed numberof bits for a conversion density range; binary digitization means forcomparing the digital density values from said analog to digitalconversion means for the individual picture elements with a thresholdlevel to convert each of the digital density values into one of twobinary values of black and white; histogram production means forproducing a histogram of density values of a noticed picture element andpicture elements around the noticed picture element; setting means forsetting a conversion density range for the noticed picture element inresponse to a density range of a peak appearing in the histogramproduced by said histogram production means; and conversion means forconverting the digital density value of the noticed picture element fromsaid analog to digital conversion means into another digital densityvalue using a scale obtained by dividing the conversion density rangeset by setting means by a number provided by the fixed number of bits.4. The image processing apparatus as claimed in claim 3, wherein saidconversion means includes a lookup table which is used also for a memoryfor γ conversion.
 5. An image processing apparatus, comprising:a sensorfor detecting a density value of image data for each picture element;analog to digital conversion means for converting analog density valuesobtained from said sensor into digital density values of a fixed numberof bits for a conversion density range; conversion density range settingmeans for setting the conversion density range of said analog to digitalconversion means; binary digitization means for comparing the digitaldensity values from said analog to digital conversion means for theindividual picture elements with a threshold level to convert each ofthe digital density values into one of two binary values of black andwhite; histogram production means for producing a histogram of densityvalues of a noticed picture element and picture elements a-round thenoticed picture element; and conversion density range modification meansfor modifying the conversion density range set by said conversiondensity range setting means in response to a density range of a peakappearing in the histogram produced by said histogram production means.6. The image processing apparatus as claimed in claim 5, wherein saidconversion density range setting means includes:ground color levelsetting means for setting an analog density value corresponding to aground color of the image data detected by said sensor as a ground colorlevel reference value; high density level setting means for setting ananalog density value corresponding to high density side image datadetected by said sensor as a high density level reference value; and lowdensity level setting means for setting an analog density valuecorresponding to low density side image data detected by said sensor asa low density level reference value; and said conversion density rangemodification means is constructed as change-over means for selecting oneof the high density level reference value from said high density levelsetting means and the low density level reference value from said lowdensity level setting means in response to the density range of the peakappearing in the histogram produced by said histogram production meansand outputting the selected reference value to said analog to digitalconversion means; the conversion density range for said analog todigital conversion means being set in accordance with the ground colorlevel reference value from said ground color level setting means and theselected reference value from said change-over means.